import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import {ActivatedRoute,Router} from '@angular/router'
import { ClueDataService } from '../../../../../@core/service/clue-service/clue-data.service';
import { CaseService } from '../../../../../@core/service/handle-service/api/case.service';

import {CaseReviewService} from '../../../../../@core/service/case-review/case-review.service'
@Component({
  selector: 'app-previewdocument',
  templateUrl: './previewdocument.component.html',
  styleUrls: ['./previewdocument.component.scss']
})
export class PreviewdocumentComponent implements OnInit {
  favoriteColorControl = new FormControl('');
  public myDoc:any;
  public myflag:boolean;
  public case:any;
  public clueDoc:any;
  public registerDepartName:string;
  public sendMsg:object = {};
  // 底部card控制显示隐藏
  public isExpand:boolean = false;

  constructor(private route: ActivatedRoute,public router:Router,public clueData:ClueDataService,
    public caseService:CaseService,
    public caseReview:CaseReviewService) {
 }
  ngOnInit() {
    this.clueData.getDepart();
    var id = this.route.snapshot.params['id'];

    this.caseService.caseIdIdGet(id).subscribe(({data}:any)=>{
      this.case = data;
      this.case.provider = JSON.parse(this.case.provider);
    })
  }

  dodoc(e){
    if(e){
      this.myDoc=e;
      this.myflag = true;
    }else{
      this.myflag = false;
    }
  }

  fun(ev){
    this.myflag = ev;
  }

  emitFather(){

  }
   // 关闭卡片
   closeCard(){
      this.isExpand  = false;
  }
  // 切换卡片事件
  cardToggle($event){
    if($event){
      this.isExpand  = $event
    }
  }
}
